#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
//add newcanselinfopage head files
#include"newcanselinfopage.h"
//add #include "cananalysis.h"
#include "cananalysis.h"
#include"canig.h"

#include <windows.h>
#include <QApplication>
#include <QMainWindow>
#include <QPushButton>
#include <QVBoxLayout>
#include <QLabel>
#include <QThreadPool>
#include "worker.h"
#include "sendthread.h"

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
class QTabWidget;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_pushButtonstart_clicked();
    void showvalue(  QVector<WorkThread::MyStruct> value,int n);
    void showvalue_send(  QVector<SendThread::MyStruct> value,int n);

    void on_pushButton_end_clicked();

    void on_textEditmycal_textChanged();

    void on_textEditmysend_textChanged();

private:

    Ui::MainWindow *ui;
    //add qtabwidget
    QTabWidget *tabWidget;
    //add newcanselinfoPage
    //NewCanSelInfoPage *newCanSelInfoPage;
    //add cananalysis
    //cananalysis *cananal;
    WorkThread *workethread;
    SendThread *sendthread;




// private slots:
//     void startTasks()
//     {
//         statusLabel->setText("Tasks are running...");
//             Worker *worker = new Worker(1);
//             connect(worker, &Worker::taskFinished, this, &MainWindow::onTaskFinished);
//             QThreadPool::globalInstance()->start(worker);
//     }

//     void onTaskFinished(int taskId)
//     {
//         int i=0;
//         while (1) {
//             i++;
//             _sleep(2);
//             statusLabel->setText(QString("Task %1 is :%2running.").arg(taskId,i));

//         }
//     }

// private:
//     QLabel *statusLabel;
//     int taskCount;
};
#endif // MAINWINDOW_H
